# coding: utf-8
"""
@python version : python3.10
@file name      : permission.py
@date           : 2024/4/28 16:35
@author         : ziyang.yang@aliyun.com
@gitee          : https://gitee.com/ziyangyang1318
@blog           : www.yangziyang.top
@describe       : 
"""
from rest_framework.permissions import BasePermission


class UsersPermission(BasePermission):
    def has_permission(self, request, view):
        if request.user.user_type == 1:
            return True
        else:
            self.message = '无权限咯'
            return False
